package com.wnxy.pawnbackgroundsystem.controller;

import com.wnxy.pawnbackgroundsystem.response.Result;
import com.wnxy.pawnbackgroundsystem.service.impl.BrandSortServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/pawnbackgroundsystem/brandsort")
public class BrandSortController {
    @Autowired
    private BrandSortServiceImpl brandSortServiceImpl;

    @GetMapping("/getSortIds")
    @CrossOrigin("*")
    public Result getSortIds(Integer brandId){
        System.out.println(brandId);
        List<Integer> sortIds = brandSortServiceImpl.getSortIds(brandId);
        return new Result(true,"2002","查询成功",sortIds);
    }

    //根据大类id组删除关联
    @DeleteMapping("/delMany")
    @CrossOrigin("*")
    public Result delMany(@RequestParam(value = "intList") List<Integer> intList){
        brandSortServiceImpl.delMany(intList);
        return new Result(true,"2002","删除成功",null);
    }

}
